package com.yanqu.road.entity.wingroom;

import com.yanqu.road.entity.DataObject;

import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author ：zfr
 * @date ：2022/1/21 16:06
 */
public class UserWingRoomShareEvent extends DataObject {
    private long userId;
    private long lastUpdateTime;
    private int judgeFailTimes;
    private long triggerTime;
    private int status; //未触发 初始态 已领取 已分享 (0 1 2 3)
    private long getRewardTime;
    private Map<Integer, WingRoomEventReward> rewardMap = new ConcurrentHashMap<>();
    private String shareUnionUid = "";
    private boolean needSync;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getJudgeFailTimes() {
        return judgeFailTimes;
    }

    public void setJudgeFailTimes(int judgeFailTimes) {
        if (this.judgeFailTimes != judgeFailTimes) {
            this.judgeFailTimes = judgeFailTimes;
            setUpdateOption();
        }
    }

    public long getTriggerTime() {
        return triggerTime;
    }

    public void setTriggerTime(long triggerTime) {
        if (this.triggerTime != triggerTime) {
            this.triggerTime = triggerTime;
            setUpdateOption();
        }
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        if (this.status != status) {
            this.status = status;
            setUpdateOption();
        }
    }

    public long getGetRewardTime() {
        return getRewardTime;
    }

    public void setGetRewardTime(long getRewardTime) {
        if (this.getRewardTime != getRewardTime) {
            this.getRewardTime = getRewardTime;
            setUpdateOption();
        }
    }

    public Map<Integer, WingRoomEventReward> getRewardMap() {
        return rewardMap;
    }

    public void setRewardMap(Map<Integer, WingRoomEventReward> rewardMap) {
        this.rewardMap = rewardMap;
        setUpdateOption();
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        if (this.lastUpdateTime != lastUpdateTime) {
            this.lastUpdateTime = lastUpdateTime;
            setUpdateOption();
        }
    }

    public String getShareUnionUid() {
        return shareUnionUid;
    }

    public void setShareUnionUid(String shareUnionUid) {
        if (!Objects.equals(this.shareUnionUid, shareUnionUid)) {
            this.shareUnionUid = shareUnionUid;
            setUpdateOption();
        }
    }

    public boolean isNeedSync() {
        return needSync;
    }

    public void setNeedSync(boolean needSync) {
        this.needSync = needSync;
    }
}
